filename = 'hematite';
mkdir(filename);
cd(filename);

Jobfile.write();
copyfile('../POTCAR', '.');

directory1 = 'ion1';
mkdir(directory1);
cd(directory1);
 
kObj = KPOINTS('K-points', 0, {'Monkhorst Pack'}, [8 8 8; 0 0 0]);
kObj.write;

INCAR.write_ion_relaxation()
eta = 55.195;
co = Crystal.create_hematite_rhombohedral;
co.convert_rhombohedral_to_hexagonal;
clf;
co.plot_atoms;

pos = POSCAR('hematite', 1, co.LatticeVectors,...
        co.NumAtoms, 'C', co.Positions);
pos.write('D');
cd('../');

directory2 = 'lattice1';
mkdir(directory2);
cd(directory2);

kObj.write;
INCAR.write_lattice_relaxation()

cd('../');
directory3 = 'ion2';
mkdir(directory3);
cd(directory3);
kObj.write;
INCAR.write_ion_relaxation()


cd('../');
directory4 = 'lattice2';
mkdir(directory4);
cd(directory4);
kObj.write;
INCAR.write_lattice_relaxation()

cd('../');
directory5 = 'sc';
mkdir(directory5);
cd(directory5);
kObj.write;
INCAR.write_sc()

cd('../');
directory6 = 'bandstructure';
mkdir(directory6);
cd(directory6);

kObj1 = KPOINTS.create_RHL_1_bandstructure(eta*degree);
kObj1.write;
INCAR.write_bandstructure()

cd('../');
directory7 = 'DOS';
mkdir(directory7);
cd(directory7);

INCAR.write_DOS()
copyfile('../../POTCAR', '.');
kObj = KPOINTS('K-points', 0, {'Monkhorst Pack'}, [21 21 21; 0 0 0]);
kObj.write;

cd('../');




 
